home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / comm2 / amislt14.lha / AmiSlate / Install_AmiSlate < prev    next >
Text File  |  1996-01-27  |  8KB  |  208 lines

  1. ; Installation script for AmiSlate 1.4
  2. ; by Jeremy Friesner
  3.  
  4. (transcript "On installing AmiSlate 1.4...")
  5.  
  6. ; make sure "rx" is available
  7. (if (not (exists "sys:rexxc/rx"))
  8.     (abort "This installer script needs to use the ARexx utility rx.\n\nPlease make sure the rx utility is installed in sys:rexxc and try to install again."))
  9.  
  10. (if (> (run "assign SlateRexx: EXISTS" (safe)) 0)
  11.     (set DefaultUpdate 0)    
  12.     (set DefaultUpdate 1)
  13. )
  14.  
  15. (set SlateUpdate
  16.       (askchoice
  17.          (prompt "Select which kind of AmiSlate install you want:")
  18.          (choices "First Time Install" "Update")
  19.          (default DefaultUpdate)
  20.          (help "If you've never installed AmiSlate on your system before, select First Time Install.  If you've alread installed an earlier version, select Update.  In an update, no new AmiSlate drawer will be created.")
  21.       )
  22. )
  23.       
  24. (set TestASTwoTwoFiveAssign (run "assign inet: EXISTS" (safe)))
  25. (set TestAmiTCPAssign (run "assign AmiTCP: EXISTS" (safe)))
  26.  
  27. ; default == no net package installed
  28. (set NetworkPackage 2)
  29.  
  30. ; if found inet: assign, change default to AS225 installed
  31. (if (= TestASTwoTwoFiveAssign 0) (set NetworkPackage 1))
  32.  
  33. ; if found AmiTCP: assign, change default to AmiTCP installed
  34. (if (= TestAmiTCPAssign 0)       (set NetworkPackage 0))
  35.  
  36. ; Get the 100% final word from the user, though
  37. (set NetworkPackage
  38.       (askchoice
  39.          (prompt "Please select the network package you have installed.")
  40.          (choices "AmiTCP" "AS225" "None")
  41.          (default NetworkPackage)
  42.          (help "AmiSlate is compatible with both AmiTCP and AS225, and can also be run (sans connect ability) without a network package.")
  43.    ))
  44.  
  45. ; determine our root net-package directory from this choice
  46.  
  47. ; default
  48. (set DefDir "")
  49.  
  50. (if (= NetworkPackage 0) 
  51.   (
  52.     (set NetName "AmiTCP")
  53.     (set AmiSlateExecutableName "AmiSlate_AmiTCP")
  54.     (set CheckThisAssign TestAmiTCPAssign)
  55.     (set UserName "root")
  56.     (if (= 0 CheckThisAssign) (set DefDir "AmiTCP:"))
  57.   )
  58. )
  59. (if (= NetworkPackage 1) 
  60.   (
  61.     (set NetName "AS225")
  62.     (set AmiSlateExecutableName "AmiSlate_AS225")
  63.     (set CheckThisAssign TestASTwoTwoFiveAssign)
  64.     (set UserName "")
  65.     (if (= 0 CheckThisAssign) (set DefDir "inet:"))
  66.   )
  67. )
  68. (if (= NetworkPackage 2) 
  69.   (
  70.     (set NetName "None")
  71.     (set AmiSlateExecutableName "AmiSlate_AmiTCP")
  72.     (set CheckThisAssign 5)
  73.   )
  74. )
  75.  
  76. (if (= SlateUpdate 0)
  77.     (
  78.         ; first time install--ask for directory to create
  79.         (set SlateDir
  80.             (askdir
  81.                 (prompt "Where would you like to install AmiSlate??\n(A drawer named \"AmiSlate\" will be created in the directory you select)")
  82.                 (help @askdir-help)
  83.                 (default DefDir)
  84.             )
  85.         )
  86.         ; make the new directory
  87.         (set NewDir (tackon SlateDir "AmiSlate"))
  88.         (makedir (NewDir) (infos))
  89.     )
  90.     (
  91.         ; update install--ask for directory where current executable is
  92.         (set NewDir
  93.             (askdir
  94.                 (prompt "Where is AmiSlate currently installed??\n(Select the drawer where the old AmiSlate executable is currently located)")
  95.                 (help @askdir-help)
  96.                 (default DefDir)
  97.             )
  98.         )
  99.     )
  100. )
  101.  
  102. (if (= SlateUpdate 0)
  103.     (
  104.         ; direct copy all files but the Install and executables, then assign to the subdir
  105.         (copyfiles
  106.             (prompt (cat "Copying Docs & Scripts to " NewDir))
  107.             (help @copyfiles-help)
  108.             (source "")
  109.             (infos)
  110.             (pattern "~(AmiSlate_AS225#?|AmiSlate_AmiTCP#?|Install#?)")
  111.             (dest NewDir)
  112.         )
  113.         ; now copy the correct executable.
  114.         (copyfiles
  115.             (prompt (cat "Copying executable " AmiSlateExecutableName " to " NewDir))
  116.             (help @copyfiles-help)
  117.             (source "")
  118.             (infos)
  119.             (pattern AmiSlateExecutableName)
  120.             (dest NewDir)
  121.         )
  122.     )
  123.     (
  124.         ; assigns already made, must copy manually
  125.         (copyfiles
  126.             (prompt (cat "Copying " AmiSlateExecutableName ", docs and scripts to " NewDir))
  127.             (help @copyfiles-help)
  128.             (source "")
  129.             (infos)
  130.             (pattern (cat "(" AmiSlateExecutableName "|Doc|ExampleRexx|Readme)"))
  131.             (dest NewDir)
  132.         )
  133.         (copyfiles
  134.             (prompt "Copying ARexx files to SlateRexx:")
  135.             (help @copyfiles-help)
  136.             (source "SlateRexx")
  137.             (files)
  138.             (pattern "#?.(rexx|slatefont)")
  139.             (dest "SlateRexx:")
  140.         )
  141.         (copyfiles
  142.             (prompt "Copying script files to SlateScripts:")
  143.             (help @copyfiles-help)
  144.             (source "SlateScripts")
  145.             (files)
  146.             (pattern "#?")
  147.             (dest "SlateScripts:")
  148.         )
  149.     )
  150. )
  151.  
  152. ; if we haven't been installed before, we need to make the SlateRexx: and SlateScripts: assigns
  153. (if (= SlateUpdate 0)
  154.  (
  155.     (set AssignString1 ("assign SlateRexx: %s/SlateRexx" NewDir ))
  156.     (run AssignString1)
  157.     (set AssignString2 ("assign SlateScripts: %s/SlateScripts\n" NewDir))
  158.     (run AssignString2)
  159.  
  160.     (set AssignString ("assign SlateRexx: %s/SlateRexx\nassign SlateScripts: %s/SlateScripts\n" NewDir NewDir))
  161.     (startup "AmiSlate"
  162.             (prompt "For correct operation, AmiSlate needs two assigns to be present.  These assigns are \n\nSlateRexx: and SlateScripts:\n\n and should be assigned to the installed directories with the same names.  Do you wish me to put the appropriate assigns in your s:user-startup?")
  163.             (help "Sometimes a remote AmiSlate client will request the local one to run an ARexx macro or a AmiSlate recording.  These assigns will be the default directories for these scripts.")
  164.             (command AssignString)
  165.     )
  166.     (run AssignString)
  167.  )
  168. )
  169.  
  170. ; if We have a network package installed...
  171. (if (< NetworkPackage 2)
  172.     ; if the proper assign (AmiTCP: or inet:) is not present...
  173.     (if (> CheckThisAssign 0)
  174.         ; give a nice error message to that effect.
  175.         (message (cat "\n\n" NetName " does not appear to be set up on your system.  (i.e. there is no " DefDir " assign!)  Because of this, I am unable to configure the " DefDir "db/services and " DefDir "db/inetd.conf files.\n\nIf you wish to use the network functions of AmiSlate, you will need to set up " NetName " and install again."))
  176.         ; otherwise put our line into the config files
  177.         (
  178.             ; make sure correct the entry is written in the services file
  179.             (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx " DefDir "db/services AmiSlate AmiSlate^^^^^^^^2955/tcp"))
  180.             (debug ARexxRunString)
  181.             (run
  182.                 (ARexxRunString)
  183.                 (prompt (cat "\nIf you plan to run AmiSlate in conjunction with " NetName ", the line:\n\nAmiSlate      2955/tcp\n\nneeds to be present in your " DefDir "db/services file.  Do you wish me to add it?  (The old services file will be saved to services.bak)"))
  184.                 (help (cat "Including this line in your " DefDir "db/services file tells " NetName "'s inet daemon that all requests on port 2955 should be sent to the AmiSlate program for further processing.  If this line is not included, you will not be able to receive AmiSlate requests from other people.  The ARexx script included with this archive is smart enough to add the line or change an existing line, and the original file will be copied to services.bak before it is updated."))
  185.                 (confirm)
  186.             )
  187.  
  188.             ; make sure correct the entry is written in the inetd.conf file
  189.             (set ExecFile (tackon NewDir AmiSlateExecutableName))
  190.             (set InetDString (cat "AmiSlate stream tcp nowait " UserName " " ExecFile))
  191.             (set InetDPrompt (cat "Also, if you plan run AmiSlate in conjunction with " NetName ", the line:\n\n" InetDString "\n\nneeds to be present in your " DefDir "db/inetd.conf file.  Do you wish me to append/change this line to that file?\n\n(I recommend yes, even if you are only updating from v1.3, as the executable name has changed)"))
  192.             (set InternalInetString (cat "AmiSlate^^^^stream^^^^^^tcp^nowait^" UserName "^^^^" ExecFile))
  193.             (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx " DefDir "db/inetd.conf AmiSlate " InternalInetString))
  194.             (debug ARexxRunString)
  195.             (run
  196.                 (ARexxRunString)    
  197.                 (prompt InetDPrompt)
  198.                 (help (cat "Including this line in your " DefDir "db/inetd.conf file tells " NetName " which program to run whenever it gets an AmiSlate request.  It is important that the file path and name in this line reflect the location of the AmiSlate executable.  The ARexx script included with this archive is smart enough to add the line or change an existing line, and the original file will be copied to inetd.conf.bak before it is updated."))
  199.                 (confirm)
  200.             )
  201.         )
  202.     )
  203. )
  204.  
  205. ; all done
  206. (message "\n\nAmiSlate is now installed.  Reboot your Amiga (just to be certain all assigns are made, etc.) and try it out!")
  207.  
  208.